<!--
 * @Author: GKN
 * @Date: 2023-08-21 17:14:24
 * @LastEditTime: 2024-01-26 11:09:46
 * @LastEditors: GKN
 * @Description: 
 * @FilePath: \mod\src\view\imptAc\index.vue
 * 可以输入预定的版权声明、个性签名、空行等
-->
<template>
    <div class="mainPadding p-t">
      <div class="max-w">
      <div class="flex flex-j-s">
        <div class="font-Breadcrumbs"></div>
        <el-breadcrumb separator="|">
          <el-breadcrumb-item v-for="(item,i) in breadcrumb_list" :key="i" v-show="item.isNav==1"  @click="goList(item,i)" class="cursor-p">{{ item.name }}</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      <div class="MarT">
        <el-row :gutter="20">
            <el-col :span="16">
                <div class="ad-view shadow-3">
                  <adImgView :src="ad_list1.length>0?ad_list1[0].img:''" @click="proxy.$comJs.openUrl(ad_list1.length>0?ad_list1[0]:'')" />
                </div>
            </el-col>
            <el-col :span="8">
                <div class="ad-view shadow-3">
                  <adImgView :src="ad_list2.length>0?ad_list2[0].img:''" @click="proxy.$comJs.openUrl(ad_list2.length>0?ad_list2[0]:'')" />
                </div>
            </el-col>
        </el-row>
      </div>
      <!-- <div class="withFull MarT" >
        <Card1 title="智库成员" :more="true" @moreClick="more(module_list[0].id,'智库成员')">
            <template v-slot:main1>
              <el-empty v-if="list_dy.length == 0" description="暂无内容" />
              <div class="flex" style="flex-wrap: wrap;">
                <div style="width: 20%;padding: 0 10px;" v-for="(item,i) in list_dy" :key="i">
                  <div class="border-r6" style="height: 280px;">
                    <img class="ad-img" src="https://p1.img.cctvpic.com/photoworkspace/2023/09/04/2023090406481680749.jpg" alt="">
                  </div>
                  <div class="font-title omit MarT font-text-al-l">成员：{{ item.title }}</div>
                  <div class="font-title omit MarT12 font-text-al-l">职务：{{ item.title }}</div>
                </div>
              </div>
            </template>
        </Card1>
      </div> -->
      <div class="withFull MarT" >
        <el-row :gutter="20">
          <el-col :span="16">
            <Card1 :title="list_children?list_children[0].name:''" :more="true" @moreClick="more(list_children[0].id,list_children?list_children[0].name:'')">
              <template v-slot:main1>
                <div style="height: 710px;overflow-y:auto;overflow-x:hidden;" class="p-t-10">
                  <el-empty v-if="list_hs.length == 0" description="暂无内容" />
                  <div class="MarB-25 cursor-p" v-for="(item,i) in list_hs" :key="i" @click="goInfo(item,list_children?list_children[0].name:'')">
                    <el-row :gutter="20">
                      <el-col :span="8">
                        <div class="ad-view shadow-3" style="height:150px ;">
                          <imgView :src="item.thumb" />
                        </div>
                      </el-col>
                      <el-col :span="16">
                        <div class="flex-d flex-j-c" style="height: 100%;">
                          <div class="font-title omit-2 font-text-al-l">{{ item.name }}</div>
                          <div class="font-content omit-3 MarT font-text-al-l" >{{ item.blurb }}</div>
                        </div>
                      </el-col>
                    </el-row>
                  </div>
                </div>
              </template>
            </Card1>
          </el-col>
          <el-col :span="8">
            <Card1 :title="list_children?list_children[1].name:''" :more="true" @moreClick="more(list_children[1].id,list_children?list_children[1].name:'')">
              <template v-slot:main1>
                <div style="height: 262px;" class="p-t-10">
                  <el-empty v-if="list_qy.length == 0" description="暂无内容" />
                    <div class="qyview" v-for="item in list_qy" :key="item" @click="goInfo(item,list_children?list_children[1].name:'')">
                        <el-row :gutter="20" v-if="item.thumb">
                            <el-col :span="12">
                                <div class="ad-view" style="height: 100px;">
                                    <img v-if="item.thumb" :src="proxy.$api.prefix_img+item.thumb" alt="" class="ad-img">
                                </div>
                            </el-col>
                            <el-col :span="12" >
                              <div style="height: 100px;" class="flex flex-align">
                                <div class="font-title omit-3 cursor-p">{{ item.name }}</div>
                              </div>
                            </el-col>
                        </el-row>
                        <div v-if="!item.thumb" class="font-title omit MarT24 cursor-p">{{ item.name }}</div>
                    </div>
                </div>
              </template>
            </Card1>
            <div class="ad-view MarT shadow-3" style="height: 204px;">
              <adImgView :src="ad_list2.length>1?ad_list2[1].img:''" @click="proxy.$comJs.openUrl(ad_list2.length>1?ad_list2[1]:'')" />
            </div>
            <div class="ad-view MarT shadow-3" style="height: 204px;">
              <adImgView :src="ad_list2.length>2?ad_list2[2].img:''" @click="proxy.$comJs.openUrl(ad_list2.length>2?ad_list2[2]:'')" />
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="withFull MarT">
        <Card1 :title="list_children?list_children[2].name:''" :more="true" @moreClick="more(list_children[2].id,list_children?list_children[2].name:'')">
            <template v-slot:main1>
                <el-row :gutter="20">
                  <el-empty v-if="list_dy.length == 0" description="暂无内容" style="margin:0 auto;" />
                    <el-col :span="4" v-for="(item,i) in list_dy" :key="i" @click="goInfo(item,list_children?list_children[2].name:'')" class="cursor-p">
                        <div class="border-r6" style="height: 190px;">
                            <img v-if="item.thumb" :src="proxy.$api.prefix_img+item.thumb" alt="" class="ad-img">
                            <el-empty v-if="!item.thumb" :image-size="50" description="暂无图片"  />
                        </div>
                        <div class="font-title omit MarT">{{ item.coCreator||item.name }}</div>
                    </el-col>
                </el-row>
            </template>
        </Card1>
      </div>
      <div class="withFull MarT">
        <el-row :gutter="20">
            <el-col :span="12" >
                <div class="back-fff" style="padding: 0 20px 20px 20px;height:585px;">
                  <imgView :src="bImg1"></imgView>
                </div>
                
            </el-col>
            <el-col :span="12" >
                <div class="back-fff" style="padding: 0 20px 20px 20px;height:585px;">
                  <imgView :src="bImg2"></imgView>
                </div>
            </el-col>
        </el-row>
      </div>
      <div class="withFull MarT back-fff p-r p-l p-t p-b">
        <el-row :gutter="20">
          <el-col :span="12" >
            <div v-for="(item,i) in list_tt1" :key="i" @click="goInfo(item,'信用评价')" class="ttview shadow-3 border-r6 p-l p-r omit cursor-p">{{ item.name }}</div>
          </el-col>
          <el-col :span="12" >
            <div v-for="(item,i) in list_tt2" :key="i" @click="goInfo(item,'信用评价')" class="ttview shadow-3 border-r6 p-l p-r omit cursor-p">{{ item.name }}</div>
          </el-col>
        </el-row>
      </div>
    </div>
    </div>
  </template>
  
  <script setup>
  import CryptoJS from 'crypto-js';
  import { ref,reactive, onMounted,getCurrentInstance } from "vue";
  const { proxy } = getCurrentInstance();
  import TitleView from '../components/title.vue';
  import FrameView from '../components/frame.vue';
  import Card1 from '../components/card1.vue';
  import { useRoute, useRouter } from "vue-router";
  const Router = useRouter();
  // 导航下对应模块
  const list_children = proxy.$comJs.extract(JSON.parse(localStorage.getItem( 'headerTabs' )),JSON.parse(CryptoJS.AES.decrypt(Router.currentRoute.value.query.ob,'name').toString(CryptoJS.enc.Utf8)),'name')[0].children
    // 面包屑
    const breadcrumb_list = list_children
    // 子栏目跳转
    const goList=(item,i)=>{
        Router.push({
          name:'listTab',
            query:{
            ob:proxy.$comJs.encry({
                title:item.name,
                i:i,
                titleList:list_children,
                firstTitle:proxy.$comJs.extract(JSON.parse(localStorage.getItem( 'headerTabs' )),JSON.parse(CryptoJS.AES.decrypt(Router.currentRoute.value.query.ob,'name').toString(CryptoJS.enc.Utf8)),'name')[0].name
            })
            }
        });
    }
  // 广告
    const ad_list1 = ref([])
    const ad_list2 = ref([])
    const getAd=()=>{
        proxy.$comJs.getAd(proxy.$comJs.extract(JSON.parse(localStorage.getItem( 'headerTabs' )),JSON.parse(CryptoJS.AES.decrypt(Router.currentRoute.value.query.ob,'name').toString(CryptoJS.enc.Utf8)),'name')[0].id,0,function(res){
            var list1 = [],list2=[],list3=[],list4=[],list5=[]
            res.list.map((item)=>{
                if(item.nid == 19){
                    list1.push(item)
                }
                if(item.nid == 20){
                    list2.push(item)
                }
            })
            ad_list1.value = list1.length>0?list1:[]
            ad_list2.value = list2.length>0?list2:[]

        })
    }
    getAd()
    const list_zc = ref([])
    const list_jd = []
    const list_px =  []
    const list_yx = []
    // 热点推荐
    const list_dy =  ref([])
    // 申报咨询
    const list_hs = ref([])
    // 创新前沿
    const list_qy =ref([])
    const list_tt1 = ref([])
    const list_tt2 = ref([])
  // 页面数据获取
  const getPageList=()=>{
    var p1 =[],p2=[]
      list_children.map((item,i)=>{
        if(i==0){
          proxy.$comJs.getNewList(4,item.id,{nextTag:0,prevTag:0},'',(data)=>{
            list_hs.value = data.list
          })
        }
        if(i==1){
          proxy.$comJs.getNewList(4,item.id,{nextTag:0,prevTag:0},'',(data)=>{
            list_qy.value = data.list
          })
        }
        if(i==2){
          proxy.$comJs.getNewList(6,item.id,{nextTag:0,prevTag:0},'',(data)=>{
            list_dy.value = data.list
          })
        }
        
        if(i==3){
          proxy.$comJs.getNewList(100,item.id,{nextTag:0,prevTag:0},'',(data)=>{
            list_tt1.value = data.list
          })
        }
        if(i==4){
          proxy.$comJs.getNewList(100,item.id,{nextTag:0,prevTag:0},'',(data)=>{
            list_tt2.value = data.list
          })
        }
      })
      
    }
    getPageList()
  
  const more =(id,title)=>{
    Router.push({
        path:'/animatedly/list',
        query:{
          ob:proxy.$comJs.encry({
            title:title,
            id:id,
            first_title:'智库咨询',
          })
        }
      });
  }
  const goInfo=(item,name)=>{
    const routeUrl = Router.resolve({
        path:'/animatedly/info',
        query:{
            ob:proxy.$comJs.encry({
                title:name,
                id:item.newsId,
                path:'/animatedly/list',
                first_title:'智库咨询',
                first_path:-1
            })
        }
    });
    window.open(routeUrl.href, "_blank");
  }
  // 获取团队标准封面，信用评价
  const bImg1 = ref('')
  const bImg2 = ref('')
  const get_resource =()=>{
    proxy.$http.request(proxy.$api.get_resource,'get',{},false, function (res) {
      if(res&&res.data){
        bImg2.value = res.data.data.commentCover
        bImg1.value = res.data.data.teamCover

      }
    })
  }
  get_resource()
  </script>
  
  <style lang='less' scoped>
  .pxview{
    height: 64px;
    font-size: 16px;
    line-height: 64px;
    background: #fff;
    margin-bottom: 20px;
  }
  .btn{
    width: 200px;
    height: 56px;
    background: linear-gradient(to bottom, #FF584F, #D10B00);
    border-radius: 28px 28px 28px 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    span{
      color: #fff;
      margin-left: 30px;
      font-size: 18px;
    }
  }
  .pxviewbg{
    background: url('@/assets/img/ad-bg1.png');
    background-size:100% 100% ;
  }
  .zkview{
    width: 100%;
    background: #FFFDEF;
    border-radius: 6px 6px 6px 6px;
  }
  .titlebg{
    width: 228px;
    height: 40px;
    background: url('@/assets/img/title-tip4.png');
    background-size: 100% 100%;
    font-size: 18px;
    color: #fff;
    font-weight: bold;
    line-height: 40px;
  }
  .iconview{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 28px;
    .img{
      width: 64px;
      height: 64px;
    }
    .font{
      font-size: 14px;
      margin-top:14px;
      font-weight: bold;
    }
    .font1{
      font-size: 13px;
      margin-top:14px;
    }
    .font2{
      font-size: 13px;
    }
  }
  .iconview1{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    .img{
      width: 84px;
      height: 84px;
    }
    .font{
      font-size: 14px;
      font-weight: bold;
    }
  }
  .ttview{
    height: 64px;
    text-align: left;
    font-size: 16px;
    line-height: 64px;
    margin-bottom:18px;
  }
  </style>
  
  